//
//  main.m
//  hello-oc
//
//  Created by whroid on 2020/7/4.
//  Copyright © 2020 whros. All rights reserved.
//

#import <Foundation/Foundation.h>


int main(int argc, const char * argv[]) {
    @autoreleasepool {
        // insert code here...
       NSCalendar *calendar = [[NSCalendar alloc]initWithCalendarIdentifier:NSCalendarIdentifierGregorian];
       
       unsigned unitFlags = NSCalendarUnitYear  |
                            NSCalendarUnitMonth |
                            NSCalendarUnitDay   |
                            NSCalendarUnitHour  |
                            NSCalendarUnitMinute|
                            NSCalendarUnitSecond|
                            NSCalendarUnitWeekday;
       
       NSDateComponents* components = [calendar components:unitFlags fromDate:[NSDate date]];
       NSInteger iCurYear = [components year]; //当前的年份
       NSInteger iCurMonth = [components month]; //当前的月份
       NSInteger iCurDay = [components day]; // 当前的号数
        NSLog(@"Hello World,Now is %i-%i-%i", iCurYear,iCurMonth,iCurDay);
    }
    return 0;
}
